package com.sjms._01_创建_单例;

//枚举实现
class Test4 {

    public static void main(String[] args) {
        U.INSTANCE.ooo();
        U.AAA.ooo();
        U.BBB.ooo();

        System.out.println(U.INSTANCE);//INSTANCE
        System.out.println(U.AAA);//AAAAAA
        System.out.println(U.BBB);//BBBB

    }

}

enum U {
    INSTANCE, AAA, BBB;

    public void ooo() {
        System.out.println("uuuuu");
    }

}